import React from 'react'

import { useHistory } from 'react-router'

export default function Comment () {
    const history = useHistory()
    console.log(history);



    const handlerClick = () => {
        // history.push('/home')
        // history.replace('/home')

        // history.replace('/article/1?name=李四&age=19')   //query  传递参数 ? 的形式
        history.push('/home', { name: '地理热吧' })

    }

    return (
        <>
            <div>Comment</div>

            <button onClick={handlerClick}> 点击 登录成功后 跳转到首页</button>
        </>

    )
}
